diff --git a/SPProxy/src/main/java/eu/stork/sp/ReturnAction.java b/SPProxy/src/main/java/eu/stork/sp/ReturnAction.java
index e20413c..7ef6d65 100644
--- a/SPProxy/src/main/java/eu/stork/sp/ReturnAction.java
+++ b/SPProxy/src/main/java/eu/stork/sp/ReturnAction.java
@@ -2,7 +2,6 @@ package eu.stork.sp;
 
 import java.io.IOException;
 import java.util.ArrayList;
-import java.util.List;
 import java.util.Properties;
 
 import javax.servlet.http.HttpServletRequest;
@@ -10,20 +9,21 @@ import javax.servlet.http.HttpServletResponse;
 
 import org.apache.struts2.interceptor.ServletRequestAware;
 import org.apache.struts2.interceptor.ServletResponseAware;
-import org.opensaml.saml2.core.Assertion;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.UnmodifiableIterator;
 import com.opensymphony.xwork2.Action;
 import com.opensymphony.xwork2.ActionSupport;
 
-import eu.stork.peps.auth.commons.IPersonalAttributeList;
-import eu.stork.peps.auth.commons.PEPSUtil;
-import eu.stork.peps.auth.commons.PersonalAttribute;
-import eu.stork.peps.auth.commons.STORKAuthnResponse;
-import eu.stork.peps.auth.commons.STORKStatusCode;
-import eu.stork.peps.auth.engine.STORKSAMLEngine;
-import eu.stork.peps.exceptions.STORKSAMLEngineException;
+import eu.eidas.auth.commons.EidasStringUtil;
+import eu.eidas.auth.commons.attribute.AttributeDefinition;
+import eu.eidas.auth.commons.attribute.AttributeValue;
+import eu.eidas.auth.commons.protocol.IAuthenticationResponseNoMetadata;
+import eu.eidas.auth.engine.ProtocolEngineNoMetadataI;
+import eu.eidas.engine.exceptions.EIDASSAMLEngineException;
 
 /**
  * This Action recives a SAML Response, shows it to the user and then validates
@@ -42,22 +42,18 @@ public class ReturnAction extends ActionSupport implements ServletRequestAware,
 
 	private String SAMLResponse;
 	private String samlResponseXML;
+	private String relayState = "";
 
-	private ArrayList<PersonalAttribute> attrList;
-
-	private ArrayList<PersonalAttribute> spanishAttrList;
+	private ImmutableMap<AttributeDefinition<?>, ImmutableSet<? extends AttributeValue<?>>> attrList = null;
 	
-	private String attrListString;
+	private ArrayList<String> attrListString = new ArrayList<String>();
+	private ArrayList<String> attrListValString  = new ArrayList<String>();
 
 	private String scope;
 
 	private HttpServletRequest request;
 	
-	private String isLegalPerson = "none";
-	private String oid;
-	
 	private static Properties configs;
-	private static Properties spanishProperties;
 
 	private static String providerName;
 	private static String homepage = null;
@@ -79,7 +75,7 @@ public class ReturnAction extends ActionSupport implements ServletRequestAware,
 
 		providerName = configs.getProperty(Constants.PROVIDER_NAME);
 
-		byte[] decSamlToken = PEPSUtil.decodeSAMLToken(SAMLResponse);
+		byte[] decSamlToken = EidasStringUtil.decodeBytesFromBase64(SAMLResponse);
 		samlResponseXML = new String(decSamlToken);
 
 		return Action.SUCCESS;
@@ -102,90 +98,52 @@ public class ReturnAction extends ActionSupport implements ServletRequestAware,
 		
 		homepage = configs.getProperty("sp.url");
 
-		STORKAuthnResponse authnResponse = null;
-		IPersonalAttributeList personalAttributeList = null;
+		IAuthenticationResponseNoMetadata authnResponse = null;
 
 		// Decodes SAML Response
-		byte[] decSamlToken = PEPSUtil.decodeSAMLToken(SAMLResponse);
+		byte[] decSamlToken = EidasStringUtil.decodeBytesFromBase64(SAMLResponse);
 
 		// Get SAMLEngine instance
-		STORKSAMLEngine engine = STORKSAMLEngine.getInstance(Constants.SP_CONF);
+		ProtocolEngineNoMetadataI engine = SPUtil.getProtocolEngine();
 
 		try {
 			// validate SAML Token
-			authnResponse = engine.validateSTORKAuthnResponse(decSamlToken,
-					(String) request.getRemoteHost());
-		} catch (STORKSAMLEngineException e) {
+			authnResponse = engine.unmarshallResponseAndValidate(decSamlToken,
+					(String) request.getRemoteHost(), 0, 0, 
+					configs.getProperty(Constants.SP_RETURN));
+			//TODO: Comprobar la consistencia del RelayState enviado y recibido.
+		} catch (EIDASSAMLEngineException e) {
 			logger.error(e.getMessage());
 			throw new ApplicationSpecificServiceException("No se ha podido validar el token de la SAML Response", e.getErrorMessage());
 		}			
 		
-		if (authnResponse.isFail()) {
-			throw new ApplicationSpecificServiceException("La SAML Response ha dado un fallo", authnResponse.getMessage());			
+		if (authnResponse.isFailure()) {
+			throw new ApplicationSpecificServiceException("La SAML Response ha dado un fallo", authnResponse.getStatusMessage());			
 		} else {			
 			//Get attributes
-			personalAttributeList = authnResponse.getPersonalAttributeList();
-			
-// Workaround para pruebas en local			
-//			PersonalAttribute pre_inherited = new PersonalAttribute();
-//			pre_inherited.setName("inheritedFamilyName");
-//			pre_inherited.setIsRequired(false);
-//			List<String> pre_values = new ArrayList<String>();
-//			pre_values.add("FELIZ");
-//			pre_inherited.setValue(pre_values);
-//			pre_inherited.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
-//			personalAttributeList.add(pre_inherited);			
-			
-			if (personalAttributeList.containsKey("inheritedFamilyName") && personalAttributeList.containsKey("surname")) {
-				PersonalAttribute inherited = personalAttributeList.get("inheritedFamilyName");
-				PersonalAttribute surname = personalAttributeList.get("surname");
-				if (surname != null && !surname.getValue().equals(inherited.getValue())) {
-					PersonalAttribute apellido2 = new PersonalAttribute();
-					String inheritedValue = inherited.getValue().toString().substring(1, inherited.getValue().toString().length()-1);
-					String surnameValue = surname.getValue().toString().substring(1, surname.getValue().toString().length()-1);
-					apellido2.setName("apellido2");
-					apellido2.setIsRequired(inherited.isRequired());
-					List<String> values = new ArrayList<String>();
-					values.add(surnameValue.substring(inheritedValue.length()+1));
-					apellido2.setValue(values);
-					apellido2.setStatus(STORKStatusCode.STATUS_AVAILABLE.toString());
-					personalAttributeList.add(apellido2);
-				}
-			}
-			
-			setAttrList(new ArrayList<PersonalAttribute>(personalAttributeList.values()));
-			spanishAttrList = new ArrayList<PersonalAttribute>(attrList);
-			
-			try {
-				spanishProperties = SPUtil.loadConfigs(Constants.SPANISH_SP_PROPERTIES);
-			} catch (IOException e) {
-				logger.error(e.getMessage());
-				throw new ApplicationSpecificServiceException("No se ha podido cargar el fichero de configuración en espa&nacute;ol", e.getMessage());
-			}
-			
-			for (PersonalAttribute pAt : spanishAttrList){
-				pAt.setName(spanishProperties.getProperty(pAt.getName()));
+			attrList = authnResponse.getAttributes().getAttributeMap();
+			UnmodifiableIterator<AttributeDefinition<?>> iterator = attrList.keySet().iterator();
+			while (iterator.hasNext()) {
+				AttributeDefinition<?> it = iterator.next();
+				attrListString.add(it.getFriendlyName());
+				attrListValString.add(attrList.get(it).toString());
 			}
 			
-			for (Assertion ass : authnResponse.getAssertions()){
-				if (ass.getIssuer() != null){
-					scope = ass.getIssuer().getValue();
-					
-					switch(scope.substring(0, 6)) {
-						case Constants.SCOPE_AFIRMA:
-							scope = "DNIe / Certificado electrónico";
-						break;
-						case Constants.SCOPE_AEAT:
-							scope = "Cl@ve PIN";
-						break;
-						case Constants.SCOPE_SS:
-							scope = "Cl@ve permanente";
-						break;
-						case Constants.SCOPE_STORK + "-":
-							scope = "Ciudadanos UE - " + scope.substring(6);
-					}
-					
+			if (authnResponse.getIssuer() != null){
+				scope = authnResponse.getIssuer();
+				
+				switch(scope.substring(0, 6)) {
+					case Constants.SCOPE_AFIRMA:
+						scope = "DNIe / Certificado electrónico";
 					break;
+					case Constants.SCOPE_AEAT:
+						scope = "Cl@ve PIN";
+					break;
+					case Constants.SCOPE_SS:
+						scope = "Cl@ve permanente";
+					break;
+					case Constants.SCOPE_STORK + "-":
+						scope = "Ciudadanos UE - " + scope.substring(6);
 				}
 			}
 
@@ -200,28 +158,24 @@ public class ReturnAction extends ActionSupport implements ServletRequestAware,
 	public void setServletResponse(HttpServletResponse response) {
 	}
 
-	public void setAttrList(ArrayList<PersonalAttribute> attrList) {
-		this.attrList = attrList;
-	}
-
-	public ArrayList<PersonalAttribute> getAttrList() {
+	public ImmutableMap<AttributeDefinition<?>, ImmutableSet<? extends AttributeValue<?>>> getAttrList() {
 		return attrList;
 	}
 
-	public ArrayList<PersonalAttribute> getSpanishAttrList() {
-		return spanishAttrList;
+	public ArrayList<String> getAttrListString() {
+		return attrListString;
 	}
 
-	public void setSpanishAttrList(ArrayList<PersonalAttribute> spanishAttrList) {
-		this.spanishAttrList = spanishAttrList;
+	public void setAttrListString(ArrayList<String> attrListString) {
+		this.attrListString = attrListString;
 	}
 
-	public String getAttrListString() {
-		return attrListString;
+	public ArrayList<String> getAttrListValString() {
+		return attrListValString;
 	}
 
-	public void setAttrListString(String attrListString) {
-		this.attrListString = attrListString;
+	public void setAttrListValString(ArrayList<String> attrListValString) {
+		this.attrListValString = attrListValString;
 	}
 
 	public String getScope() {
@@ -232,40 +186,12 @@ public class ReturnAction extends ActionSupport implements ServletRequestAware,
 		this.scope = scope;
 	}
 
-	/**
-	 * @return the isLegalPerson
-	 */
-	public String getIsLegalPerson() {
-		return isLegalPerson;
-	}
-
-	/**
-	 * @param isLegalPerson the isLegalPerson to set
-	 */
-	public void setIsLegalPerson(String isLegalPerson) {
-		this.isLegalPerson = isLegalPerson;
-	}
-
-	/**
-	 * @return the oid
-	 */
-	public String getOid() {
-		return oid;
-	}
-
-	/**
-	 * @param oid the oid to set
-	 */
-	public void setOid(String oid) {
-		this.oid = oid;
-	}
-
 	public String getProviderName() {
 		return providerName;
 	}
 
-	public void setProviderName(String providerName) {
-		this.providerName = providerName;
+	public void setProviderName(String provName) {
+		providerName = provName;
 	}
 
 	public String getHomepage() {
@@ -284,6 +210,14 @@ public class ReturnAction extends ActionSupport implements ServletRequestAware,
 		this.SAMLResponse = samlResponse;
 	}
 
+	public String getRelayState() {
+		return relayState;
+	}
+
+	public void setRelayState(String relayState) {
+		this.relayState = relayState;
+	}
+
 	public String getSamlResponseXML() {
 		return samlResponseXML;
 	}
diff --git a/SPProxy/src/main/webapp/returnPage.jsp b/SPProxy/src/main/webapp/returnPage.jsp
index cee9c2f..d79e02b 100644
--- a/SPProxy/src/main/webapp/returnPage.jsp
+++ b/SPProxy/src/main/webapp/returnPage.jsp
@@ -52,10 +52,6 @@
 										<input type="submit" value="Logout" />
 									</div>
 								</form>
-								<h2>
-									<s:property value="%{getText('requestedDataId')}" />
-									:
-								</h2>
 								<div id="space"></div>
 																
 								<s:set name="isLegalPerson" value="isLegalPerson"/>
@@ -65,36 +61,13 @@
 									<tr class="filatit">
 										<td><s:property value="%{getText('attributeId')}" /></td>
 										<td><s:property value="%{getText('valuesId')}" /></td>
-										<td><s:property value="%{getText('complexValuesId')}" /></td>
 									</tr>
 									<s:iterator value="attrList" status="idx">
 										<tr class="filaresult">
-											<td><s:property value="spanishAttrList[#idx.index].name" /></td>
-											<td><s:property value="attrList[#idx.index].value" /></td>
-											<td><s:property value="attrList[#idx.index].complexValue" /></td>
+											<td><s:property value="attrListString[#idx.index]" /></td>
+											<td><s:property value="attrListValString[#idx.index]" /></td>
 										</tr>
-									</s:iterator>
-									
-									
-									<s:if test="%{#isLegalPerson=='true'}">
-										<tr class="filaresult">
-											<td><s:property value="%{getText('legalPerson')}" /></td>
-											<td><s:property value="#isLegalPerson" /></td>
-											<td><s:property value="" /></td>
-										</tr>
-										<tr class="filaresult">
-											<td><s:property value="%{getText('oid')}" /></td>
-											<td><s:property value="#oid" /></td>
-											<td><s:property value="" /></td>
-										</tr>
-									</s:if>
-									<s:elseif test="%{#isLegalPerson=='false'}">
-										<tr class="filaresult">
-											<td><s:property value="%{getText('legalPerson')}" /></td>
-											<td><s:property value="#isLegalPerson" /></td>
-											<td><s:property value="" /></td>
-										</tr>
-									</s:elseif>									
+									</s:iterator>								
 								</table>
 								<p>
 									<s:property value="%{getText('errorMessage1Id')}" />